#include"../Include/WebPageSearcher.h"
#include"../Include/WebPageQuery.h"
#include"../Include/myredis++.h"
#include"../Include/SplitTool.h"
WebPageSearcher::WebPageSearcher(const string& keys):_sought(keys)
{
}
void WebPageSearcher::doQuery(SplitToolCppJieba& jieba,const string& info,vector<string>&answer)
{
Myredis rs(info);
 WebPageQuery wbq;

 if(rs.get_list(this->_sought,answer))
 {   
     return;
 }
else
 {
    wbq.doQuery(this->_sought,jieba);
    wbq.getresult(this->vec_result);
     rs.rpush(this->_sought,this->vec_result);
 }
}
string vector_string(vector<string>queryword)
{
    string temp;
    for(string a:queryword)
    temp+=a;
    return temp;
}